/* General styles */
.calendar {
    background-color: var(--bg-main);
    border-radius: 30px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.month-picker {
    padding: 5px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.month-picker:hover {
    background-color: var(--color-hover);
}

.year-change {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 10px;
    cursor: pointer;
}

.year-change:hover {
    background-color: var(--color-hover);
}

/* Calendar Week Day */
.calendar-week-day {
    height: 50px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-weight: 600;
}

.calendar-week-day div {
    display: grid;
    place-items: center;
    color: var(--bg-second);
}

/* Calendar Days */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    color: var(--color-txt);
}

.calendar-days div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    position: relative;
    cursor: pointer;
    animation: to-top 1s forwards;
}

.calendar-days div span {
    position: absolute;
}

/* Calendar Day Hover */
.calendar-days div.calendar-day-hover span:nth-child(1),
.calendar-days div.calendar-day-hover span:nth-child(3) {
    width: 2px;
    height: 0;
    background-color: var(--color-txt);
}

.calendar-days div.calendar-day-hover:hover span:nth-child(1),
.calendar-days div.calendar-day-hover:hover span:nth-child(3) {
    height: 100%;
}

.calendar-days div.calendar-day-hover span:nth-child(1) {
    bottom: 0;
    left: 0;
}

.calendar-days div.calendar-day-hover span:nth-child(3) {
    top: 0;
    right: 0;
}

.calendar-days div.calendar-day-hover span:nth-child(2),
.calendar-days div.calendar-day-hover span:nth-child(4) {
    width: 0;
    height: 2px;
    background-color: var(--color-txt);
}

.calendar-days div.calendar-day-hover:hover span:nth-child(2),
.calendar-days div.calendar-day-hover:hover span:nth-child(4) {
    width: 100%;
}

.calendar-days div.calendar-day-hover span:nth-child(2) {
    top: 0;
    left: 0;
}

.calendar-days div.calendar-day-hover span:nth-child(4) {
    bottom: 0;
    right: 0;
}

.calendar-days div.calendar-day-hover:hover span:nth-child(2) {
    transition-delay: 0.2s;
}

.calendar-days div.calendar-day-hover:hover span:nth-child(3) {
    transition-delay: 0.4s;
}

.calendar-days div.calendar-day-hover:hover span:nth-child(4) {
    transition-delay: 0.6s;
}

.calendar-days div.curr-date span {
    display: none;
}

/* Month List */
.month-list {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    background-color: var(--bg-main);
    padding: 20px;
    grid-template-columns: repeat(3, auto);
    gap: 20px;
    display: grid;
    transform: scale(0.7);
    visibility: hidden;
    pointer-events: none;
    padding: 0;
    padding-top: 20px;
}

.month-list.block {
    transform: scale(1);
    visibility: visible;
    pointer-events: visible;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.month-list > div {
    display: grid;
    place-items: center;
    margin: 2px;
}

.month-list > div > div {
    width: 100%;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    color: var(--color-txt);
}

.month-list > div > div:hover {
    background-color: var(--color-hover);
}

@keyframes to-top {
    0% {
        transform: translateY(20%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
